-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Access] Unify subscription id with client message id #6847
[Access] Unify subscription id with client message id #6847
Conversation
From now on, we use only 1 id in request/response messages. This id is called `subscription_id`. A client may provide `subscription_id` in `subscribe` request. If client does not provide it, we generate it ourselves. Clients that use browsers or other async environemnts may use `subscription_id` to correlate response messages with the request ones. `subscription_id` is used in all messages related to subscription. I also remove `success` field from response. We include `subscription_id` field in a resposne in case of OK response. In case of error response, we include `error` field.
8d1e427
to
e5a91d7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6847 +/- ##
==========================================
- Coverage 41.08% 41.07% -0.01%
==========================================
Files 2121 2121
Lines 185905 185901 -4
==========================================
- Hits 76373 76366 -7
- Misses 103118 103121 +3
Partials 6414 6414
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
return uuid.New(), nil | ||
} | ||
|
||
newID, err := uuid.Parse(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jribbink what do you think about requiring clients pass UUIDs (32 character hex strings) for the client ids? Is that reasonable or too restrictive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, if we require clients to create subscripion_id
on their side, we can go with a simple integer value for subscription_id
as a client will have control over random number generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, we decided not to require clients to provide valid uuid but rather a random string containing N characters
Client is not required to provide valid UUID for subscription ID from now on. It can be any string [1-20] characters long. If no subscription ID provided, server creates UUID string for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a few small comments, but otherwise looks good
@Guitarheroua can you take a look at this one |
Will double check it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
From commit message:
From now on, we use only 1 id in request/response messages. This id is called
subscription_id
.A client may provide
subscription_id
insubscribe
request. If client does not provide it, we generate it ourselves.Clients that use browsers or other async environments may use
subscription_id
to correlate response messages with the request ones.subscription_id
is used in all messages related to subscription.I also removed
success
field from a response. We includesubscription_id
field in a resposne in case of OK response.In case of error response, we include
error
field.Closes #6845